import Vue from 'vue';
import Vuex from 'vuex';
import createPersistedState from 'vuex-persistedstate';

// 模块
import user from './modules/user';
import settings from './modules/settings';
import cart from './modules/cart';
import getters from './getters';

Vue.use(Vuex);

export default new Vuex.Store({
  modules: {
    user,
    settings,
    cart
  },
  plugins: [
    createPersistedState({
      storage: window.sessionStorage
    })
  ],
  getters
});
